package com.dobbinsoft.iotechn.device.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dobbinsoft.iotechn.core.exception.ServiceException;
import com.dobbinsoft.iotechn.core.model.Page;
import com.dobbinsoft.iotechn.data.mapper.IMapper;
import com.dobbinsoft.iotechn.device.domain.DeviceUserDO;
import com.dobbinsoft.iotechn.device.dto.UserDeviceDTO;
import com.dobbinsoft.iotechn.device.dto.DeviceUserDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Description:
 * User: rize
 * Date: 2020/6/23
 * Time: 15:00
 */
public interface DeviceUserMapper extends IMapper<DeviceUserDO> {

    /**
     * 获取这个用户所 关联的的设备列表
     * @param page
     * @param userId
     * @return
     * @throws ServiceException
     */
    public Page<UserDeviceDTO> getDevicePage(IPage<UserDeviceDTO> page, @Param("userId") Long userId);

    public List<DeviceUserDTO> getDeviceUserWaitAudit(Long userId);

    public DeviceUserDO getDeviceUserForUpdate(Long id);

}
